Crate stabby_abi
source ·Expand description
The core of the stabby
ABI.
This crate is generally not meant to be used directly, but through the stabby
crate.
Re-exports§
pub use crate::enums::IDeterminantProvider;
pub use result::Result;
pub use option::Option;
pub use istable::Array;
pub use istable::End;
pub use istable::IStable;
Modules§
- ABI-stable smart pointers and allocated data structures, with support for custom allocators.
- Helpers to treat ABI-stable types as if they were their unstable equivalents.
- How
stabby
exposes symbols that must be checked through canaries or reflection before being accessed to prevent UB after linking ABI-incompatible functions. - Closures, but ABI-stable
- ABI-stable compact sum types!
- Futures, but ABI-stable
- The heart of
stabby
: theIStable
trait. - ABI-stable equivalents of iterators.
- Extending Non-Zero Types to enable niches for other values than 0.
- Like
core::option::Option
, but ABI-stable with niche optimizations! A stable option for when rust’sOption<T>
isn’t! - How stabby computes and generates padding to shift variants in enums
- A very simple ABI-stable reflection framework.
- Like
core::result::Result
, but ABI-stable with niche optimizations! Stable results! - ABI-stable slices. Stable slices!
- ABI-stable strs. Stable strs!
- A support module for stabby’s dark magic.
- Support for vtables for multi-trait objects
Macros§
- Expands to
assert_eq
in debug builds or if--cfg check_unreachable=true
has been set in theRUST_FLAGS
, and toif a != b {core::hint::unreachable_unchecked()}
otherwise. - Fires a compile error if the layout of a type is deemed sub-optimal.
- Expands to
assert!(condition)
in debug builds or if--cfg check_unreachable=true
has been set in theRUST_FLAGS
, and toif condition {core::hint::unreachable_unchecked()}
otherwise. - Returns the appropriate type for a stabby equivalent of a trait object.
- Expands to
unreachable!()
in debug builds or if--cfg check_unreachable=true
has been set in theRUST_FLAGS
, and tocore::hint::unreachable_unchecked
otherwise. - Returns the appropriate type of vtable for a trait object.
Structs§
- A ZST that’s only allowed to exist if its generic parameter is ABI-stable.
- A stable trait object (or a stable
&mut dyn
) - A stable
&'a dyn Traits
- Used by proc-macros to concatenate fields before wrapping them in a
Struct
to compute their layout. - Emulates a type of size
Size
and alignmentAlign
. - Lets you tell
stabby
thatT
has the same stable layout asAs
. - Used by proc-macros to ensure a list of fields gets the proper end padding.
- An ABI-stable tuple.
Traits§
- Provides access to a value as if it were of another type.
- Indicates that
Self
can be used as a pointer in dynptrs. - Provides Clone support for smart pointers that allow it.
- Indicates that
Self
can be used as an unconditionally mutable pointer in dynptrs. - Provides drop support in dynptr for pointers that have at least partial ownership of their pointee.
- Indicates that
Self
can be used as a conditionally mutable pointer in dynptrs. - Used to turn a pointer into a dynamic pointer.
- Allows casting a
dyn A + B
intodyn A
.
Functions§
- A no-op that fails to compile if
T
isn’t proven ABI-stable by stabby.
Unions§
- Used by
crate::result::Result
Attribute Macros§
- The lifeblood of stabby.